extends "../cTDZ_4_1/cTDZ_4_1.gd"
func _info():
	pass

func _connect():
	._connect()
	
func _extInit():
	._extInit()
	chaName = "红晶蟹王"
	lv = 3
	attCoe.atk = 30 / 8.5 * 2 / 3
	attCoe.maxHp = 900 / 112.5 / 3
	attCoe.def = 24 / 15.0 / 3.0
	attCoe.mgiDef = 24 / 16.6 / 3.0 
	addCdSkill("hjxw1",5)
	addSkillTxt("蟹之钳拿：对当前敌人造成88%物理伤害，附加1层<眩晕>[cd:5秒]")
	addCdSkill("hjxw2",7)
	addSkillTxt("蟹之横冲：对当前敌人造成122%魔法伤害，附加1s<眩晕>并与其交换位置[cd:7秒]")

func _castCdSkill(id):
	._castCdSkill(id)
	if id == "hjxw1" && aiCha:
		cst("蟹之钳拿","000000",position)
		hurtChara(aiCha,att.atk*0.88,Chara.HurtType.PHY,Chara.AtkType.SKILL)
		aiCha.addBuff(ctrl.b_xuanyun.new(1))

	if id == "hjxw2" && aiCha:
		cst("蟹之横冲","000000",position)
		hurtChara(aiCha,att.atk*1.22,Chara.HurtType.MGI,Chara.AtkType.SKILL)
		var tcell1 = aiCha.cell
		var tp1 = aiCha.position
		var tcell2 = cell
		var tp2 = position
		if aiCha:
			aiCha.position = tp2
			self.position = tp1
			aiCha.cell = tcell2
			self.cell = tcell1
			aiCha.aiCha = null
			self.aiCha = aiCha

		else:
			if setCell(tcell1):
				self.position = tp1
				self.aiCha = aiCha
		aiCha.addBuff(ctrl.b_xuanyun.new(0.5))